﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>App1</title>

    <!-- WinJS references -->
    <link href="//Microsoft.WinJS.1.0.RC/css/ui-dark.css" rel="stylesheet" />
    <script src="//Microsoft.WinJS.1.0.RC/js/base.js"></script>
    <script src="//Microsoft.WinJS.1.0.RC/js/ui.js"></script>

    <!-- App1 references -->
    <link href="/css/default.css" rel="stylesheet" />
    <script src="/js/default.js"></script>
    <script>
        (function () {
            "use strict";
            var url = " http://localhost:8592/api/ItemModel";

            var ButtonToAdd = document.getElementById('ButtonAdd');
            {


                WinJS.xhr({ url: url }).then(function (r) {
                    var result = JSON.parse(r.responseText);
                   
                    var dataList = new WinJS.Binding.List(result);

                    // Create a namespace to make the data publicly
                    // accessible. 
                    var publicMembers =
                        {
                            itemList: dataList
                        };
                    WinJS.Namespace.define("DataExample", publicMembers);
                    var myListView = document.getElementById("basicListView1").winControl;
                    myListView.selectionMode = WinJS.UI.SelectionMode.single;
                    myListView.itemDataSource = DataExample.itemList.dataSource;
                });
            };
        })();
    </script>
</head>
<body>
  <div id="basicListView1" class="groupeditemslist" aria-label="List of groups" data-win-control="WinJS.UI.ListView"></div>
</body>
</html>
